x$religio <- factor(x$rlgdnm, levels = c(1,2,3,4,5,6,7,8,66,77,99),
labels = c("Roman Catholic", "Protestant","Eastern Orthodox",
"Other Christian denomination", "Jewish", "Islamic",
"Eastern religions","Other non-Christian religions",
"Ateu", "No answer", "No answer"))
Convertir lrscale a factor qualitatiu
x$lrscale <- factor(x$lrscale,
levels = c(0:10, 77, 88, 99),
labels = c("Left", 1, 2, 3, 4, 5, 6, 7, 8, 9, "Right", "Refusal", "Don't know", "No answer"))
Pol_Re <- x[, c(
"cntry", "essround",
# Religió
"religio", "rlgdgr", "rlgatnd", "pray",
# Política
"lrscale", "polintr", "vote", "ptcpplt",
"trstprt", "trstprl", "trstplt",
# Economia / benestar
"stfeco", "gincdif", "freehms", "happy", "hlthhmp",
# Pes
"dweight"
)]
write.csv(Pol_Re, file = "Pol_Re_processat.csv", row.names = FALSE)